#pragma once
#include <iostream>
#include <pthread.h>
#include "pthreadPool.hpp"
using namespace std;
typedef void *(*func)(void *);
class thread
{
public:
    thread(func fun,void* args) : _func(fun)
    {
        pthread_create(&tid, nullptr, _func, args);
    }
    ~thread()
    {
        pthread_join(tid, nullptr);
    }

private:
    pthread_t tid;
    func _func;
};